magnifier: Clip child node to magnifier size
authorTimm Bäder <mail@baedert.org>
Fri, 16 Mar 2018 20:30:31 +0000 (21:30 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 17 Mar 2018 11:09:30 +0000 (12:09 +0100)
It's still broken in several other ways, but now one less.

gtk/gtkmagnifier.c

index 875342a463b54e6379e9de3760ae8ef8c3f8089b..c69b3cbdee4d75138b98145d69e214a8771b7383 100644 (file)
@@ -125,12 +125,20 @@ gtk_magnifier_snapshot (GtkWidget   *widget,
 
   if (inspected_node != NULL)
     {
+      gtk_snapshot_push_clip (snapshot,
+                              &GRAPHENE_RECT_INIT (0, 0,
+                                                   gtk_widget_get_width (widget),
+                                                   gtk_widget_get_height (widget)),
+                              "MagnifierClip");
+
       graphene_matrix_init_identity (&transform);
       graphene_matrix_scale (&transform, priv->magnification, priv->magnification, 1);
 
       gtk_snapshot_push_transform (snapshot, &transform, "Magnifier transform");
       gtk_snapshot_append_node (snapshot, inspected_node);
       gtk_snapshot_pop (snapshot);
+
+      gtk_snapshot_pop (snapshot);
     }